<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
<title>图书管理系统</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Modern Responsive web template, Bootstrap Web Templates, Flat Web Templates, Andriod Compatible web template, 
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
 <!-- Bootstrap Core CSS -->
<link href="/bookManage/Public/admin/css/bootstrap.min.css" rel='stylesheet' type='text/css' />
<!-- Custom CSS -->
<link href="/bookManage/Public/admin/css/style.css" rel='stylesheet' type='text/css' />
<!-- Graph CSS -->
<link href="/bookManage/Public/admin/css/lines.css" rel='stylesheet' type='text/css' />
<link href="/bookManage/Public/admin/css/font-awesome.css" rel="stylesheet"> 
<!-- jQuery -->
<script src="/bookManage/Public/admin/js/jquery.min.js"></script>
<!----webfonts--->
<link href='http://fonts.useso.com/css?family=Roboto:400,100,300,500,700,900' rel='stylesheet' type='text/css'>
<!---//webfonts--->  
<!-- Nav CSS -->
<link href="/bookManage/Public/admin/css/custom.css" rel="stylesheet">
<!-- Metis Menu Plugin JavaScript -->
<script src="/bookManage/Public/admin/js/metisMenu.min.js"></script>
<script src="/bookManage/Public/admin/js/custom.js"></script>
<!-- Graph JavaScript -->
<script src="/bookManage/Public/admin/js/d3.v3.js"></script>
<script src="/bookManage/Public/admin/js/rickshaw.js"></script>
</head>
<body>
<div id="wrapper">
     <!-- Navigation -->
        <nav class="top1 navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="sr-only">图书管理系统</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="index.html">图书管理系统</a>
            </div>
            <!-- /.navbar-header -->
            <ul class="nav navbar-nav navbar-right">
			    <li class="dropdown">
	        		<a href="#" class="dropdown-toggle avatar" data-toggle="dropdown"><img src="/bookManage/Public/admin/images/6.png"></a>
	        		<ul class="dropdown-menu">
						<li class="dropdown-menu-header text-center">
							<strong>管理员</strong>
						</li>
						<li class="m_2"><a href="#"><i class="fa fa-wrench"></i> 修改密码</a></li>
						<li class="m_2"><a href="#"><i class="fa fa-lock"></i> 安全退出</a></li>	
	        		</ul>
	      		</li>
			</ul>
            <div class="navbar-default sidebar" role="navigation">
                <div class="sidebar-nav navbar-collapse">
                    <ul class="nav" id="side-menu">
                        <li>
                            <a href="<?php echo U('admin/index/index');?>"><i class="fa fa-dashboard fa-fw nav_icon"></i>主页</a>
                        </li>
                        <li>
                            <a href="#"><i class="fa fa-sitemap fa-fw nav_icon"></i>图书管理<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                                <li>
                                    <a href="<?php echo U('admin/book/addbook');?>">新书入库</a>
                                </li>
                                <li>
                                    <a href="<?php echo U('admin/book/listbook');?>">图书管理</a>
                                </li>
                                <li>
                                    <a href="<?php echo U('admin/book/borrowbook');?>">借书</a>
                                </li>
                                <li>
                                    <a href="<?php echo U('admin/book/backList');?>">还书</a>
                                </li>
                                <li>
                                    <a href="<?php echo U('admin/book/addcate');?>">添加分类</a>
                                </li>
                                <li>
                                    <a href="<?php echo U('admin/book/listCate');?>">管理分类</a>
                                </li>
                            </ul>
                            <!-- /.nav-second-level -->
                        </li>
                        <li>
                            <a href="#"><i class="fa fa-indent nav_icon"></i>通知消息<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                                <li>
                                    <a href="graphs.html">发布信息</a>
                                </li>
                                <li>
                                    <a href="typography.html">管理信息</a>
                                </li>
                            </ul>
                            <!-- /.nav-second-level -->
                        </li>
                        <li>
                            <a href="#"><i class="fa fa-table nav_icon"></i>用户管理<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                                <li>
                                    <a href="<?php echo U('admin/user/adduser');?>">用户登记</a>
                                </li>
                                <li>
                                    <a href="<?php echo U('admin/user/listuser');?>">用户列表</a>
                                </li>
                            </ul>
                            <!-- /.nav-second-level -->
                        </li>
                        <li>
                            <a href="#"><i class="fa fa-laptop nav_icon"></i>管理员<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                                <li>
                                    <a href="grids.html">修改密码</a>
                                </li>
                                <li>
                                    <a href="grids.html">安全退出</a>
                                </li>
                            </ul>
                            <!-- /.nav-second-level -->
                        </li>
                    </ul>
                </div>
                <!-- /.sidebar-collapse -->
            </div>
            <!-- /.navbar-static-side -->
        </nav>

        <div id="page-wrapper">
        <div class="col-md-12 graphs">
	   <div class="xs" style="min-height: 460px;">
  	 <h3>还书</h3>
   <div class="panel-body1">
<script type="text/javascript">
  function checkUser(){
    document.getElementById("formid").submit();
  }
</script>
  <form action="<?php echo U('admin/book/backList');?>" method="get" id="formid">
        <div class="input-group">
            <input type="text" name="pname" class="form-control1 input-search" placeholder="请输入还书用户名">
            <span class="input-group-btn">
                <button class="btn btn-success" style="height: 40px;" type="button" onclick="checkUser();"><i class="fa fa-search"></i></button>
            </span>
        </div><!-- Input Group -->
  </form>
   <table class="table nth-child table-striped table-hover">
     <thead>
        <tr>
          <th>#</th>
          <th>书名</th>
          <th>借阅时间</th>
          <th>最晚归还时间</th>
          <th>借阅人</th>
          <th>状态</th>
          <th width="10%">操作</th>
        </tr>
      </thead>
      <tbody>
        <?php if(is_array($backlist)): foreach($backlist as $key=>$b): ?><tr>
          <th scope="row"><?php echo ($b["id"]); ?></th>
          <td><?php echo ($b["b_name"]); ?></td>
          <td><?php echo (date('Y-m-d H:i:s',$b["addtime"])); ?></td>
          <td><?php echo (date('Y-m-d H:i:s',$b["lasttime"])); ?></td>
          <td><?php echo ($b["pname"]); ?></td>
          <td>
            <?php if($b['mark'] == 0): ?><span style="color: green;">未超时，剩余天数：<?php echo ($b["residue"]); ?></span>
            <?php else: ?>
              <span style="color: red;">已超时<?php echo ($b["residue"]); ?>天</span><?php endif; ?>
          </td>
          <td><a href="<?php echo U('admin/book/backBook',array('id'=>$b['id'],'pname'=>$_GET['pname']));?>">归还</a></td>
        </tr><?php endforeach; endif; ?>
      </tbody>
    </table>
    </div>
  </div>
    <br>
		<div class="copy">
            <p>Copyright &copy; 2017.Company name All rights reserved.</p>
	    </div>
		</div>
       </div>
      <!-- /#page-wrapper -->
   </div>
    <!-- /#wrapper -->
    <!-- Bootstrap Core JavaScript -->
    <script src="/bookManage/Public/admin/js/bootstrap.min.js"></script>
</body>
</html>